100分 <html:optionsCollection和<html:options的区别

来源:百度知道 编辑:UC知道 时间:2024/05/30 07:37:36
想问一下两者的区别?
<html:options collection="renjihe" property="实际值" labelProperty="显示值" />

还有一个小问题 就是在<html:options里面
<html:options name="xxx"
我知道 xxx 代表的是request范围里的 list<form>的名字
那这个name 跟collection 有什么区别呢?

意思就是<html:options name="xxx"
跟<html:options collection="xxx" 有什么却别

还有就是两个标签 <html:optionsCollection和<html:options有什么区别

<html:optionsCollection>可直接放集合
例如有一个集合对象为List<Student> studentList
而这个Student类又有属性name和Id;
那么想直接在下拉列表框里显示集合里的所有成员
<html:select>
<html:optionsCollection name="studentList" lable="列表显示的比如name" value="id">
</html:select>
这样就把这个集合显示在下拉列表框里了

-------------------
html:optionsCollection标签

html:optionsCollection标签生成多个HTML的option元素。

<html:select name="selectForm" property="person.id" size="1">
<html:optionsCollection name="selectForm" property="persons" label="name" value="id"/>
</html:select>
html:optionsCollection标签就是一个可以很容易就实现动态下拉列表实现的一个标签

--------------------------------------------------------------------------------
html:options标签

html:options标签生成多个HTML的option元素。

<bean:define id="personCollection&qu